package com.mytomcat.servlet.impl;

import com.mytomcat.servlet.MyHttpServlet;
import com.mytomcat.servlet.MyHttpServletRequest;
import com.mytomcat.servlet.MyHttpServletResponse;

// myTomcat内置的处理所有异常的Servlet
final public class ExceptionServlet extends MyHttpServlet {

    @Override
    public void doGet(MyHttpServletRequest request, MyHttpServletResponse response) throws Exception {
        doPost(request, response);
    }

    @Override
    public void doPost(MyHttpServletRequest request, MyHttpServletResponse response) throws Exception {
        response.returnHtmlResponse(500,"500 服务器异常 " + request);
    }
}
